﻿PARAM($ModificationType,$DN,[HashTable] $AnchorAttributes,[hashTable] $ChangedAttributes,[hashTable] $AddValues,[hashTable] $RemoveValues)


"### RunStep = $RunStepType, RunPartition = $RunStepPartition ###" | out-file -FilePath "c:\ChangedAttributes.txt" -Append

"DN = $DN" | out-file -FilePath "c:\ChangedAttributes.txt" -Append
"Object ModificationType = $ModificationType" | out-file -FilePath "c:\ChangedAttributes.txt" -Append

foreach($key in $AnchorAttributes.keys)
{
    $value=$AnchorAttributes[$key]
    "Anchor attribute : $key, Value= $value" | out-file -FilePath "c:\ChangedAttributes.txt" -Append
}

foreach($key in $ChangedAttributes.keys)
{
    $value=$ChangedAttributes[$key]
    "Attribute Changed : $key, Change Type= $value" | out-file -FilePath "c:\ChangedAttributes.txt" -Append
}

foreach($key in $AddValues.Keys)
{
    $values=$AddValues[$key]
    foreach($value in $values)
    {
        "Add value $value to $key" | out-file -FilePath "c:\ChangedAttributes.txt" -Append
    }
}

foreach($key in $RemoveValues.Keys)
{
    $values=$RemoveValues[$key]
    foreach($value in $values)
    {
        "Remove value $value from $key" | out-file -FilePath "c:\ChangedAttributes.txt" -Append
    }
}

"" | out-file -FilePath "c:\ChangedAttributes.txt" -Append